home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
utility
/
nodee1a.zip
/
SOURCE.ZIP
/
PS.CPP
< prev
next >
Wrap
Text File
|
1991-09-15
|
1KB
|
79 lines
#include <iostream.h>
#include <fstream.h>
#ifndef __STRING_H
#include <string.h>
#endif
#ifndef __DIR_H
#include <dir.h>
#endif
#ifndef __WINDOWS_H
#include <windows.h>
#endif
#ifndef __PS_H
#include "ps.h"
#endif
/* Define the members of PSClean */
int PSFile::strip(void)
{
char str[80];
int j,i;
if (bValidFile)
{
ifstream io(szFullQFile);
if ( io )
{
io.getline(str,80);
io.close();
if (strchr(str,4) != NULL);
{
fstream io(szFullQFile,ios::in|ios::out);
io.seekp(0,ios::beg);
j=strlen(str);
for(i=0;i<j;i++)
if ( str[i] != 0x4)
io.put(str[i]);
io.close();
return 1;
}
}
}
return 0;
}
BOOL PSFile::test()
{
#define SZPOSTSCRIPT "%!PS"
char str[80];
BOOL i,j;
if (bValidFile)
{
ifstream io(szFullQFile);
if ( io )
{
io.getline(str,80);
io.close();
i=(strstr(str,SZPOSTSCRIPT) != (char*)NULL) ;
j=(strchr(str,4) != (char *)NULL);
if (i && j)
return TRUE;
}
}
return FALSE;
}